import http from "@/utils/http.js"//引入http模块
const module = {
    namespaced:true,//开启命名空间
    state: {
        cinemaList: []
    },
    mutations: {
        setCinemaData(store, data) {
            store.cinemaList=data
        },
        clearDataList(store) {
            store.cinemaList = []
        }
    },
    actions: {
        getCinemaData(store,cityId) {
            return http({
                url:`/gateway?cityId=${cityId}&ticketFlag=1&k=3269820`,
                headers: {
                    'X-Host': 'mall.film-ticket.cinema.list'
                }
            }).then((res)=>{
                // console.log(res)
                store.commit("setCinemaData",res.data.data.cinemas) 
            })
        }
    }
}
export default module